<template>
  <div>
    <span @click="jian(item)">-</span>
    <span>{{ item.count }}</span>
    <span @click="add(item)">+</span>
  </div>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {},
    },
  },
  methods: {
    jian(item) {
      if (item.count > 0) {
        item.count--;
      }
    },
    add(item) {
      item.count++;
    },
  },
};
</script>

<style lang="scss" scoped>

</style>